package leetcode.weekly.week311;

//Solution2Test
public class Solution2 {

	public int longestContinuousSubstring(String s) {
		char[] cs = s.toCharArray();
		int l = 0, r = 1;
		int ans = 1;
		while (r < cs.length) {
			while (r < cs.length && cs[r] - cs[r - 1] == 1) {
				r++;
			}
			ans = Math.max(ans, r - l);
			l = r;
			r++;
		}
		return ans;
	}

}
